﻿@{
    Layout = null;
}
@using Kevin.Shop.Business.Service.Entity.Helper
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta charset="utf-8">
    <link href="~/Themes/RongJi/Style/feedback/css/common.css" rel="stylesheet" />
    <link href="~/Themes/RongJi/Style/feedback/css/onlinebooking.css" rel="stylesheet" />
    <script src="~/Utility/jquery-1.9.1.min.js"></script>
    <title>意见和反馈</title>
    <meta content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport">
    <!-- Mobile Devices Support begin -->
    <meta content="no-cache,must-revalidate" http-equiv="Cache-Control">
    <meta content="no-cache" http-equiv="pragma">
    <meta content="0" http-equiv="expires">
    <meta content="telephone=no, address=no" name="format-detection">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <!-- apple devices fullscreen -->
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
    <!-- Mobile Devices Support end -->
    <link rel="shortcut icon" href="http://stc.weimob.com/img/favicon.ico">
    <style>
        img {
            max-width: 100%!important;
        }
    </style>
</head>
<body onselectstart="return true;" ondragstart="return false;" id="onlinebooking">
   @* <div class="qiandaobanner">
        <img src="~/Themes/RongJi/Style/feedback/imgs/head_pic.jpg">
    </div>*@
    <div class="cardexplain">
        <ul class="round">
            <li>
                <h2>意见和反馈说明</h2>
                <div class="text">我们会认真采纳您的意见，会及时给您回信。</div>
            </li>
        </ul>

        <!--粉丝填写过的信息的，直接就显示名字电话，粉丝没有填写过信息的话，这里就直接留空让粉丝填写-->
        <ul class="round">
            <form action="javascript:;" method="post">
                <li class="title mb"><span class="none">请认真填写表单</span></li>
                <li class="nob">
                    <input name="formhash" id="formhash" value="2be3071a" type="hidden">
                    <table class="kuang" border="0" cellpadding="0" cellspacing="0" width="100%">
                        <tbody>
                            <tr>
                                <th>邮箱</th>
                                <td>
                                    @if (WebClientContext.Current.UserId <=0)
                                    {
                                        <input name="email" class="px" id="email" value="" placeholder="请输入您的邮箱" type="text">
                                    }
                                    else
                                    {
                                        <input name="email" class="px" id="email" value="@WebClientContext.Current.CurrentUser.Email" placeholder="请输入您的邮箱" type="text">
                                    }
                                </td>
                            </tr>
                        </tbody>
                    </table>
                </li>
             @*   <li class="nob">
                    <table class="kuang" border="0" cellpadding="0" cellspacing="0" width="100%">
                        <tbody>
                            <tr>
                                <th>联系电话</th>
                                <td>
                                    <input name="tel" class="px" id="tel" value="13572651245" placeholder="请输入您的电话" type="tel"></td>
                            </tr>
                        </tbody>
                    </table>
                </li>*@
                <li class="nob">
                    <table class="kuang" border="0" cellpadding="0" cellspacing="0" width="100%">
                        <tbody>
                            <tr>
                                <th class="thtop" valign="top">意见</th>
                                <td>
                                    <textarea name="feedback" class="pxtextarea" style="height: 99px; overflow-y: visible" id="feedback" placeholder="请输入您的意见"></textarea>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                </li>
            </form>
        </ul>
        <div class="footReturn">
            <input id="sumbit" class="submit" value="提交意见" type="button">
        </div>
    </div>
    <script type="text/javascript">
        $(document).ready(function () {
            var $sumbit = $("#sumbit");
            //提交意见和反馈
            $("#sumbit").click(function () {

                $sumbit.attr('disabled', "true");
                var email = $.trim($("#email").val());
                var feedback = $.trim($("#feedback").val());
                if (email == "") {
                    alert('您没有填写邮箱！');
                    $sumbit.removeAttr("disabled");

                    return false;
                }

                var reg = /^([a-zA-Z0-9_\.\-])+\@@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
                if (!reg.test(email)) {
                    alert('请输入正确的邮箱');
                    $sumbit.removeAttr("disabled");

                    return false;
                }

                if (feedback == "") {
                    alert('您没有填写意见！');
                    $sumbit.removeAttr("disabled");

                    return false;
                }

                var submitData = {
                    email: email,
                    feedback: feedback
                };

                $.ajax({
                    type: "POST",
                    data: submitData,
                    dataType: "JSON",
                    url: "/Customer/FeedbackSubmit",
                    success: function (response) {
                        if (response.Status == false && response.ErrorMessage == 'noHasEmail') {
                            alert('您没有填写邮箱！');
                            $sumbit.removeAttr("disabled");

                            return false;
                        }
                        else if (response.Status == false && response.ErrorMessage == 'noHasFeedback') {
                            alert('您没有填写意见！');
                            $sumbit.removeAttr("disabled");

                            return false;
                        }
                        else if (response.Status == true && response.ErrorMessage == 'submitSuccessfully')
                        {
                            alert('感谢您的意见，我们会认真阅读！');

                            return true;
                        }
                    },
                    error: function (err) {
                        //alert('异常错误！');
                        return false;
                    }
                });
            });
        });
    </script>
</body>
</html>
